<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@page import="java.util.List"%>

<%@include file='head.jsp'%>

<body>
<div id="page" class="shell">
	<%@include file="menu.jsp" %>
	
	<!-- Main -->
	<div id="main">
            <h2>Clientes</h2>

            <form action="Controladora?action=ConsultarCliente" method="post" id="search">
                <div>
                    <p>Entre com nome, cpf ou email do cliente (ou parte dos dados):</p>
                    <input type="text" id="busca" name="busca" value=""/>
                    <button id="submit" class="submit" type="submit"><i class='icon-search'></i>Buscar</button>
                </div>
                <div class="cl">&nbsp;</div>
            </form>

            <table>
                <thead>
                    <tr>
                        <th>Nome</th>
                        <th>Telefone</th>
                        <th>Email</th>
                        <th>Ver Mais</th>
                        <th>Editar</th>
                        <th>Excluir</th>
                    </tr>
                </thead>
                <tbody>
                     <c:if test="${listaCliente != null}">
                        <c:forEach var="cliente" items="${listaCliente}">
                            <tr>
                                <td><c:out value="${cliente.nome}" /></td>
                                <td><c:out value="${cliente.telefone}" /></td>
                                <td><c:out value="${cliente.email}" /></td>
                                <td><a href='Controladora?action=VerMaisCliente&id=${cliente.idCliente}'><i class='icon-eye-open'/></a></td>
                                <td><a href='Controladora?action=EditarCliente&id=${cliente.idCliente}'><i class='icon-edit'/></a></td>
                                <td><a href='Controladora?action=ExcluirCliente&id=${cliente.idCliente}' onclick='return confirmaDeletar();'><i class='icon-trash'/></a></td>
                            </tr>
                         </c:forEach>
                     </c:if>
                </tbody>
            </table>
</div>
	<!-- END Main -->

	<%@include file="footer.jsp" %>
	
	<br />
</div>
</body>
</html>